$.ajax({
  type: "GET",
  url: "/api/cart/index",
  
  success: function (res) {
    console.log(res);
    var htmlStr = template("tpl-goods", res.data);
    var htmlStr2 = template("tpl-order", res.data);
    var htmlStr3 = template("tpl-total", res.data.cartTotal);
    $(".goods-items").html(htmlStr);
    $(".order-box").html(htmlStr2);
      $(".order-total").html(htmlStr3);
      $.each($('.item'), function (i, ele) {
          if ($(ele).attr('data-checked') == 0) {
              $(ele).hide()
          }
      })
  },
});
$.ajax({
  type: "GET",
  url: "/api/cart/checkout",
    success: function (res) {
        console.log(res);
        var htmlStr = template("tpl-address", res.data.checkedAddress);
        $('.address-box').html(htmlStr)
  }
});